package org.mch.comm.ftp;

import java.io.Serializable;

/**
 * 描述：FTP参数VO；<BR>
 * 
 * 类名：FTPParamerVO.java<BR>
 * 
 * @author zl；DateTime：2007-6-30<BR>
 * 
 *         说明：<BR>
 * <BR>
 */
public class FtpParam implements Serializable {
	private static final long serialVersionUID = -5309705052179446506L;

	/**
	 * 上传文件的加密密钥；
	 */
	private String secretkey;

	/**
	 * 地址；
	 */
	private String address;

	/**
	 * 端口；
	 */
	private int port;

	/**
	 * 用户名；
	 */
	private String username;

	/**
	 * 密码；
	 */
	private String password;

	/**
	 * 初始根目录路径，如："/test/"、"/"、"/test/tmp/"；
	 */
	private String rootpath;

	/**
	 * 标书模板目录；
	 */
	private String bsmodelpath;

	/**
	 * 供应商标书上传目录；
	 */
	private String gysbspath;

	/**
	 * 供应商资料目录；
	 */
	private String gyszl;

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public int getPort() {
		return port;
	}

	public String getBsmodelpath() {
		return bsmodelpath;
	}

	public void setBsmodelpath(String bsmodelpath) {
		this.bsmodelpath = bsmodelpath;
	}

	public String getGysbspath() {
		return gysbspath;
	}

	public void setGysbspath(String gysbspath) {
		this.gysbspath = gysbspath;
	}

	public String getGyszl() {
		return gyszl;
	}

	public void setGyszl(String gyszl) {
		this.gyszl = gyszl;
	}

	public void setPort(int port) {
		this.port = port;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRootpath() throws Exception {
		if (this.rootpath == null) {
			throw new Exception("请设置FTP上传的根目录！");
		}
		if (!"/".equals(this.rootpath)) {
			if (!this.rootpath.substring(0, 1).equals("/")
					|| !this.rootpath.substring(this.rootpath.length() - 1, this.rootpath.length()).equals("/")) {
				throw new Exception("根目录格式应为：\"/test/\"、\"/\"、\"/test/tmp/\"！");
			}
		}
		return this.rootpath;
	}

	public void setRootpath(String rootpath) {
		this.rootpath = rootpath;
	}

	public String getSecretkey() {
		return secretkey;
	}

	public void setSecretkey(String secretkey) {
		this.secretkey = secretkey;
	}

}
